import request from "../utils/request";
import { ILoginInfo , ILoginResponse} from './types/common'



export const getLoginInfo = () => {
    return request<ILoginInfo>({
        method: "GET",
        url:'/login/info'
    })
}

export const getCaptcha = () => {
    return request<Blob>({
        method: "GET",
        params: {
            timestamp: +new Date()
        },
        url:'/captcha_pro',
        responseType: 'blob'
    })
}

export const login = (data: {
    account: string
    pwd: string
    imgcode: string
  }) => {
    return request<ILoginResponse>({
      method: 'POST',
      url: '/login',
      data
    })
  }
  
  export const logout = () => {
    return Promise.resolve()
    return request({
      method: 'GET',
      url: '/setting/admin/logout'
    })
  }
  